Skip to content

[ai] AIOS-5522 推理模板一键导入 — SDK/ApiHelper 占位#3901

Closed
zstack-robot-1 wants to merge 4 commits intofeature-5.5.22-aiosfrom
sync/zstackio/feat/AIOS-5522-import-template@@2
Closed

[ai] AIOS-5522 推理模板一键导入 — SDK/ApiHelper 占位#3901
zstack-robot-1 wants to merge 4 commits intofeature-5.5.22-aiosfrom
sync/zstackio/feat/AIOS-5522-import-template@@2

Conversation

@zstack-robot-1
Copy link
Copy Markdown
Collaborator

说明

与 premium!13787 配对的占位 PR。

本 PR 目前无实质代码变更,待 premium 侧合并后在 Docker 环境执行以下步骤补齐:

./runMavenProfile premium
./runMavenProfile sdk
cd sdk && mvn install -DskipTests=true && cd ..
./runMavenProfile apihelper
# 将生成的 ApiHelper 覆盖 testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
./runMavenProfile docpremium

生成的 SDK + ApiHelper + API 文档模板将在后续 commit 补入本分支。

关联 premium PR:http://dev.zstack.io:9080/zstackio/premium/-/merge_requests/13787

sync from gitlab !9785

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 8, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: http://open.zstack.ai:20001/code-reviews/zstack-cloud.yaml (via .coderabbit.yaml)

Review profile: CHILL

Plan: Pro

Run ID: 20b9740d-8665-43cb-b6e5-a14aa53acd9d

📥 Commits

Reviewing files that changed from the base of the PR and between 98fa429 and 0cfb8a8.

⛔ Files ignored due to path filters (4)
  • sdk/src/main/java/org/zstack/sdk/AutoMatchModelServiceByModelResult.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/QueryCdnModelServiceTemplateListAction.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/QueryCdnModelServiceTemplateListResult.java is excluded by !sdk/**
  • sdk/src/main/java/org/zstack/sdk/UpdateModelAction.java is excluded by !sdk/**
📒 Files selected for processing (1)
  • testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy

Walkthrough

向 ModelServiceVO 表新增可空列 hasNewVersion;在测试库 ApiHelper.groovy 中新增五个 DSL 方法,用于从 CDN/上传/URL 导入、查询与同步模型服务模板,并在启用 apipath 时记录 API 路径。

模型服务模板支持

Layer / File(s) Summary
数据库架构
conf/db/upgrade/V5.5.22__schema.sql
ModelServiceVO 表新增可空列 hasNewVersion TINYINT(1)(默认 NULL)。
测试DSL助手 - import from CDN
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
新增 importModelServiceTemplateFromCdn:构建 ImportModelServiceTemplateFromCdnAction、注入 sessionId、以闭包配置并执行,条件性记录 API 路径,返回 errorOut(a.call())
测试DSL助手 - import from upload
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
新增 importModelServiceTemplateFromUpload:构建 ImportModelServiceTemplateFromUploadAction,行为与 CDN 导入方法相同。
测试DSL助手 - import from URL
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
新增 importModelServiceTemplateFromUrl:构建 ImportModelServiceTemplateFromUrlAction,行为与其他导入方法一致。
测试DSL助手 - query list
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
新增 queryCdnModelServiceTemplateList:构建 QueryCdnModelServiceTemplateListAction、注入会话、执行闭包、将 conditions 元素转为字符串,并在启用 apipath 时派生/记录 apiId 与 API 路径,返回 errorOut(a.call())
测试DSL助手 - sync
testlib/src/main/java/org/zstack/testlib/ApiHelper.groovy
新增 syncCdnModelServiceTemplate:构建 SyncCdnModelServiceTemplateAction、注入会话、执行闭包并在启用 apipath 时设置/记录 apiId 与 API 路径,返回 errorOut(a.call())
sequenceDiagram
  participant Test
  participant ApiHelper
  participant Action
  participant ApiPathTracker
  Test->>ApiHelper: 调用 DSL 方法(closure)
  ApiHelper->>Action: new SpecificAction() / 设置 sessionId
  ApiHelper->>Action: 将 closure 作为 delegate 并执行
  Action->>Action: call()
  alt apipath 启用
    ApiHelper->>ApiPathTracker: 记录 apiId / path 信息
    ApiPathTracker->>Test: 更新 Test.apiPaths
  end
  ApiHelper-->>Test: 返回 errorOut(a.call()) 结果
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 数据库里埋新田,
新列记录版本间。
导入上传与网址连,
CDN 同步亦可见。
测试助手闭包舞翩跹.


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Title check ❌ Error PR标题不符合指定格式。标题为中文且不遵循'[scope]: '格式(应为英文,最多72字符)。 修改标题格式为'[scope]: '且使用英文,例如:'[ai][aios]: Add template import SDK/ApiHelper placeholder',确保不超过72字符。
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed PR描述清晰说明了这是一个占位PR,关联premium!13787,包含后续完成步骤,与变更集相关。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sync/zstackio/feat/AIOS-5522-import-template@@2

Comment @coderabbitai help to get the list of available commands and usage tips.

DBImpact

Change-Id: I68707570767978766a64737265706f737a65736e
@MatheMatrix MatheMatrix force-pushed the sync/zstackio/feat/AIOS-5522-import-template@@2 branch from 10fe681 to 3ba5085 Compare May 8, 2026 16:00
Keep the zstack SDK surface aligned with the premium API change by exposing the explicit CDN template sync action and the query-style inventories field. The legacy templates accessor is preserved so existing callers continue to work while APIQuery responses move to inventories.

Resolves: ZSTAC-84025

Change-Id: Idbed10f55118f3d4f8f49b305f8c08ce8095d865
@MatheMatrix MatheMatrix force-pushed the sync/zstackio/feat/AIOS-5522-import-template@@2 branch from 77384ab to c6328cd Compare May 11, 2026 02:22
AlanJager added 2 commits May 11, 2026 12:14
Resolves: ZSTAC-84025

Change-Id: I7a7a766c61707667676f64636177636d7a717466
Signed-off-by: AlanJager <ye.zou@zstack.io>
Resolves: ZSTAC-84025

Change-Id: I6c6772706775716f6a696c7364796374686d706d
Signed-off-by: AlanJager <ye.zou@zstack.io>
@MatheMatrix MatheMatrix force-pushed the sync/zstackio/feat/AIOS-5522-import-template@@2 branch from 98fa429 to 0cfb8a8 Compare May 11, 2026 04:19
@ZStack-Robot ZStack-Robot deleted the sync/zstackio/feat/AIOS-5522-import-template@@2 branch May 11, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants